package com.zatech.cgnci.project.controller;


import com.zatech.cgnci.project.service.CgnciReInsuranceCompanyAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * <p>
 * 再保公司账户表 前端控制器
 * </p>
 *
 * @author Generator
 * @since 2024-12-17
 */
@RestController
@RequestMapping("/api/insurance-company-account")
@Api(produces = "application/json",tags = "再保公司账户api接口文档")
@RequiredArgsConstructor
public class CgnciReInsuranceCompanyAccountController {

    private final CgnciReInsuranceCompanyAccountService reInsuranceCompanyAccountService;

    @GetMapping("/deleteById")
    @ApiOperation(value ="删除")
    public void deleteById(@RequestParam(value = "id") Long id) {
        reInsuranceCompanyAccountService.removeById(id);
    }

    @GetMapping("/deleteByIds")
    @ApiOperation(value ="批量删除")
    public void deleteByIds(@RequestParam(value = "ids") String accIds) {
        List<Long> idList = Arrays.stream(accIds.split(",")).map(Long::valueOf).collect(Collectors.toList());
        reInsuranceCompanyAccountService.removeByIds(idList);
    }

}

